<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>搜索框</title>
    <link rel="stylesheet" href="./css/style.css">
    <!-- 第一步 引入swiper插件 css和js -->
    <link rel="stylesheet" href="https://unpkg.com/swiper@8/swiper-bundle.css">
    <style>
        .swiper {
            width: 100%;
            height: 200px;
        }

        .swiper img {
            width: 100%;
            height: 200px;
        }
    </style>
</head>

<body>
    <!-- 搜索区域 -->
    <div class="g-search">
        <h2>城市</h2>
        <input type="text" placeholder="请输入搜索内容" />
        <h2>登录</h2>
    </div>
    <!-- 轮播区域 -->
    <div class="swiper">
        <div class="swiper-wrapper">
            <div class="swiper-slide">
                <img src="../img/banner1.png" alt="banner1">
            </div>
            <div class="swiper-slide">
                <img src="../img/banner2.png" alt="banner2">
            </div>
            <div class="swiper-slide">
                <img src="../img/banner3.png" alt="banner3">
            </div>
        </div>
        <div class="swiper-pagination"></div>
    </div>

    <script src="https://unpkg.com/swiper@8/swiper-bundle.js"> </script>

    <script>
        new Swiper('.swiper', {
            loop: true, // 循环模式选项
            autoplay: { delay: 1000, }, //自动轮播
            effect: 'fade',
            slidesPerView: 3,
            centeredSlides: true,
            // 如果需要分页器
            pagination: {
                el: '.swiper-pagination',
            },
        })

    </script>
</body>

</html>